<template>
  <div class="Userreport">
    <section class="toolTop">
      <el-row :gutter="24" class="top_wrap">
        <el-col :span="8">
          <el-card class="box-card" shadow="hover">
            <div class="clearfix">
              <div class="exdot"></div>
              <span class="title">所有用户</span>
            </div>
            <div class="text item">
              <span class="extotal">{{count}}</span>
              <span class="wrod">所有用户</span>
            </div>
          </el-card>
        </el-col>
        <el-col :span="8">
          <el-card class="box-card" shadow="hover">
            <div class="clearfix">
              <div class="sucdot"></div>
              <span class="title">激活用户</span>
            </div>
            <div class="text item">
              <span class="suctotal">{{activeData}}</span>
              <span class="wrod">可以正常使用的用户</span>
            </div>
          </el-card>
        </el-col>
        <!-- <el-col :span="6">
          <el-card class="box-card" shadow="hover">
            <div class="clearfix">
              <div class="huldot"></div>
              <span class="title">异常用户</span>
            </div>
            <div class="text item">
              <span class="hultotal">329</span>
              <span class="wrod">离线用户</span>
            </div>
          </el-card>
        </el-col> -->
        <el-col :span="8">
          <el-card class="box-card" shadow="hover">
            <div class="clearfix">
              <div class="dealdot"></div>
              <span class="title">未激活用户</span>
            </div>
            <div class="text item">
              <span class="dealtotal">{{unactiveData}}</span>
              <span class="wrod">已锁定、未激活的用户</span>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </section>
    <section class="main_table">
      <el-form :inline="true" class="demo-form-inline">
        <h1 class="title">用户总表</h1>
        <el-form-item>
          <el-button class="el-icon-download"  @click="outExcel">导出</el-button>
        </el-form-item>
      </el-form>
      <el-table
        ref="multipleTable"
        v-bind:data="userreportData"
        style="width: 100%"
        v-bind:max-height="height"
        v-bind:header-cell-style="{background: '#1f2548',color:'#ffffff'}"
        v-bind:cell-style="{padding:'10px',}"
        @selection-change="handleSelectionChange"
        fit
      >
        <el-table-column align="center" type="selection" max-width="120"></el-table-column>
        <el-table-column align="center" prop="name" label="用户名称"></el-table-column>
        <el-table-column align="center" prop="email" label="邮箱" max-width="120"></el-table-column>
        <el-table-column align="center" prop="phone" label="电话号码" max-width="120"></el-table-column>
        <el-table-column align="center" prop="createDate" label="创建时间" max-width="120"></el-table-column>
        <el-table-column align="center" prop="remarks" label="描述" max-width="120"></el-table-column>
      </el-table>
      <section class="toolFoot">
        <el-row :gutter="25">
          <el-col :span="24" class="rightCol">
            <el-pagination
              small
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[5, 10, 15, 20]"
              :page-size="pagesize"
              layout="total, sizes, prev, pager, next ,jumper"
              :total="total"
              :pager-count="5"
            ></el-pagination>
          </el-col>
        </el-row>
      </section>
    </section>
  </div>
</template>

<script type="text/javascript" src="../../api/datamg/userreport.js"></script>

<style lang="scss">
.Userreport {
  flex: 1;
  > section {
    &.toolTop {
      height: auto !important;
      padding-bottom: 17px;
      .top_wrap {
        border-radius: 5px;
        padding: 8px 16px;
        .box-card {
          border-radius: 5px;
          background-color: #1f2548;
          border: 1px solid #1f2548;
          .clearfix {
            display: flex;
            flex-direction: row;
            padding: 0px 10px;
            .exdot {
              border: 4px solid #2c82e0;
              width: 20px;
              height: 20px;
              border-radius: 20px;
              margin-top: 2.3%;
            }
            .sucdot {
              border: 4px solid #129161;
              width: 20px;
              height: 20px;
              border-radius: 20px;
              margin-top: 2.3%;
            }
            .huldot {
              border: 4px solid #f8666a;
              width: 20px;
              height: 20px;
              border-radius: 20px;
              margin-top: 2.3%;
            }
            .dealdot {
              border: 4px solid #f39d13;
              width: 20px;
              height: 20px;
              border-radius: 20px;
              margin-top: 2.3%;
            }
            .title {
              margin-top: 1%;
              margin-left: 4%;
              font-size: 3rem;
              color: #ffffff;
              font-weight: 500;
              justify-content: center;
              align-items: center;
            }
          }
          .item {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 20px;
            margin-bottom: 16px;
            .extotal {
              font-size: 11rem;
              color: #2c82e0;
              font-family: "DIN-Medium";
            }
            .suctotal {
              font-size: 11rem;
              color: #129161;
              font-family: "DIN-Medium";
            }
            .hultotal {
              font-size: 11rem;
              color: #f8666a;
              font-family: "DIN-Medium";
            }
            .dealtotal {
              font-size: 11rem;
              color: #f39d13;
              font-family: "DIN-Medium";
            }
            .wrod {
              font-size: 2rem;
              color: #ffffff;
              margin-top: 5px;
            }
          }
        }
      }
    }
    &.main_table {
      border-radius: 5px;
      padding: 14px;
      //background-color: #fff;
      margin-bottom: 16px;
      .cell {
        padding-left: 0px;
        padding-right: 0px;
      }
      > .toolFoot {
        margin-top: 16px;
        .rightCol {
          text-align: right;
          .el-pagination--small {
            white-space: nowrap;
            padding: 2px 5px;
            color: #303133;
            font-weight: 700;
            height: 50px;
            span {
              color: #fff;
              line-height: 30px;
              .el-input {
                .el-input__inner {
                  height: 30px;
                  line-height: 30px;
                }
              }
            }
          }
        }
      }
      > .el-form {
        display: flex;
        flex-direction: row;
        .title {
          color: #ffffff;
          font-size: 3rem;
          width: 95%;
        }
        .el-button {
          height: 30px;
          padding: 7px 20px;
          background-color: #161836;
          border: 1px solid #85899c;
          color: #85899c;
        }
        .el-button:hover,
        .el-button:focus {
          background-color: #161836;
          font-size: 14px;
          padding: 7px 20px;
          color: #fff;
          border: 1px solid #fff;
        }
      }
    }
  }
}
</style>
